var app = new Vue({
    el:"#app",
    data:{
        city:'广州',
        list:[]
    },
    methods: {
        search:function () {
            var that = this;
            axios.get('http://wthrcdn.etouch.cn/weather_mini?city='+this.city).then(function (response){
                    // response为自己定义的形参，可以随便定义
                    // console.log(response.data.data);
                    // console.log(response.data.data.yesterday);
                console.log(response.data.data.forecast);
                that.list = response.data.data.forecast;
                console.log(that.list);
                },function (err) {  }
            )
        },
        change:function(city) {
            this.city = city;
            this.search();
        }
        // queryWeather() {
        //     this.list = [];
        //     axios
        //         .get(`http://wthrcdn.etouch.cn/weather_mini?city=${this.city}`)
        //         .then(res => {
        //         console.log(res);
        //     this.list = res.data.data.forecast;
        // })
        // .catch(err => {
        //         console.log(err);
        // })
        // .finally(() => { });
        // }
    },
})